From 97ed0bad2f002b5367bd0598dd27315c92c4e717 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jonas=20Dre=C3=9Fler?= Date: Tue, 8 Jul 2025 16:58:25 +0200 Subject: [PATCH] windowPreview: Replace the click action with a click and long press gesture In the porting, temporarily stop integrating the WindowPreview gestures with DnD, this used to be done through addClickAction() but DnD will change to using gestures in later commits, making its porting moot. This integration will be restored later on. Part-of: --- js/ui/windowPreview.js | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/js/ui/windowPreview.js b/js/ui/windowPreview.js index 3bc04187e..6e1593de8 100644 --- a/js/ui/windowPreview.js +++ b/js/ui/windowPreview.js @@ -115,15 +115,13 @@ export const WindowPreview = GObject.registerClass({ this); this.inDrag = false; - let clickAction = new Clutter.ClickAction(); - clickAction.connect('clicked', () => this._activate()); - clickAction.connect('long-press', (action, actor, state) => { - if (state === Clutter.LongPressState.ACTIVATE) - this.showOverlay(true); - return true; - }); + const clickGesture = new Clutter.ClickGesture(); + clickGesture.connect('recognize', () => this._activate()); + this.add_action(clickGesture); - this._draggable.addClickAction(clickAction); + const longPressGesture = new Clutter.LongPressGesture(); + longPressGesture.connect('recognize', () => this.showOverlay(true)); + this.add_action(longPressGesture); this._overlayEnabled = true; this._overlayShown = false; -- 2.39.5